package com.fan.admin.dao;

import com.fan.commons.pojo.Course;
import com.fan.commons.pojo.Teacher;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author fan
 * @date 2021/2/4
 */
@Mapper
public interface TeacherMapper {

	/**
	 * 添加教师信息
	 *
	 * @param teacher
	 * @return
	 */
	int insertTeacher(Teacher teacher);

	/**
	 * 查询 teachers
	 *
	 * @return
	 */
	List<Teacher> queryTeachers(Teacher teacher);

	@Select("select teacher_id from teacher where college_id = #{collegeId} and system_id = #{systemId} order by id desc limit 1")
	String getTeacherId(@Param(value = "collegeId") String collegeId, @Param(value = "systemId") String systemId);

	int updateTeacherById(Teacher teacher);

	int deleteTeacherById(@Param("id") Integer id);

	List<Course> teacherCourseCla(@Param("teacherId") String teacherId);
}
